//package src;
import java.awt.*;
import java.awt.geom.*;
import java.io.*;

public class ShapeOval extends Shape implements Serializable
{

	private int left, top;
  	private int width, height;
  	private Ellipse2D.Double ellipse;
	
  	public ShapeOval(int left, int top, int width, int height, Color color)
  	{
  		super(color);
		this.left = left;
    	this.top = top;
   		this.width = width;
   		this.height = height;
  	}
  	
	public void draw(Graphics g)
  	{
  		Graphics2D g2d = (Graphics2D)g;							
				
    	ellipse = new Ellipse2D.Double(left, top, width, height);
		g2d.draw(ellipse); 
    }
	
	public int setLeftPoint(int x)
	{
		return left = x;
	}
	
	public int setTopPoint(int y)
	{
		return top = y;
	}
	
	private void writeObject (ObjectOutputStream out) throws IOException
	{
		out.writeInt(left);
		out.writeInt(top);
		out.writeInt(width);
		out.writeInt(height);
	}
	
	private void readObject (ObjectInputStream in) throws IOException, ClassNotFoundException
	{
		left = in.readInt();
		top = in.readInt();
		width = in.readInt();
		height = in.readInt();
		
	}

}
